$(document).ready(function(){
  var h3=$('h3')
  console.log(h3.text());
   h3.html('<del>123457890</del>');//删除线  往DOM中新增内容
   h3.attr('data-src','images/2.png');//设置属性值

   console.log(h3.attr('data-src'));
   h3.attr('title',123);//鼠标移入出现标题显示

   var usr=$('#username'),
	   music=$('#music'),
	   pwd1=$('#pwd1');
   music.prop('checked',true);//prop属性更多的应用于表单中
   console.log(music.removeProp('checked'));
   console.log(usr.prop('autofocus',false));

   pwd1.keydown(function(e){
		if(e.keyCode==13){
		  console.log(usr.val());
		  console.log(music.val());
		}
   });
   var btns=$('button'),
	   btnshow=btns.eq(1);
	btns.click(function(){
		$(this).toggleClass('pop');
	});
	btns.dblclick(function(){
		$(this).removeClass('pop');
	});

	var a=$('#h4 a'),
		h5=$('h5');
	h5.append(a);
	//h5.bofore(a);
	//h5.after(a);
	//h5.prepend(a);

	var aaa=$('<div>',{
		"class":'test',
		text:'click me!',
		click:function(){
			$(this).toggleClass('pop');
	  }		
		
	});
	aaa.appendTo(h5);
	//console.log(h5.clone().appendTo($(document.body)));
	console.log(h5.children('div'));

	var div1=$('#div1');
		console.log(div1.children());

     var div2=$('#div2 p');
	    div2.parents('div').css('border','2px solid crimson');
	
	var $btns=$('.banner button');
		$btns.first().addClass('pop');
		$btns.on('click',function(){
			$(this).addClass('pop').siblings().removeClass('pop');
		});

	var pa=$('#div2 h6'),
		test=pa.first().prev();
	console.log(test);
});
